
using System.Data.Entity.ModelConfiguration;

namespace OBUCare.Core.Models.Mapping
{
    public class SYSTEM_LOGSMap : EntityTypeConfiguration<SYSTEM_LOGS>
    {
        public SYSTEM_LOGSMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.CLIENT_IP)
                .IsRequired()
                .HasMaxLength(200);

            this.Property(t => t.OPERATOR_NO)
                .IsRequired()
                .HasMaxLength(16);

            this.Property(t => t.OPERATOR_NAME)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.AGENT_NO)
                .IsRequired()
                .HasMaxLength(16);

            this.Property(t => t.AGENT_NAME)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.REMARK)
                .IsRequired();

            // Table & Column Mappings
            this.ToTable("SYSTEM_LOGS");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.CLIENT_IP).HasColumnName("CLIENT_IP");
            this.Property(t => t.SYSTEM_OPERATION_KIND).HasColumnName("SYSTEM_OPERATION_KIND");
            this.Property(t => t.OPERATOR_NO).HasColumnName("OPERATOR_NO");
            this.Property(t => t.OPERATOR_NAME).HasColumnName("OPERATOR_NAME");
            this.Property(t => t.AGENT_NO).HasColumnName("AGENT_NO");
            this.Property(t => t.AGENT_NAME).HasColumnName("AGENT_NAME");
            this.Property(t => t.RECORD_TIME).HasColumnName("RECORD_TIME");
            this.Property(t => t.REMARK).HasColumnName("REMARK");
        }
    }
}
